USE [AnotherSuccessfulProcedure]

IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].[DeathsSelectCountByPlayerIdLogId]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
BEGIN
	DROP PROCEDURE dbo.DeathsSelectCountByPlayerIdLogId
END


SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Neil Wilson
-- Create date: 09/03/08
-- Description:	Kills Table Deaths Select Count By PlayerId and LogId
-- =============================================
CREATE PROCEDURE DeathsSelectCountByPlayerIdLogId

            @LogId int,
			@PlayerId varchar(30),
			@DeathCount int = 0 OUTPUT
	
AS

BEGIN

select @DeathCount = COUNT(KillId) FROM Kills WHERE LogId = @LogId AND Victim_PlayerId = @PlayerId


END
GO

